package tests;

import junit.framework.Assert;
import org.junit.Before;
import org.junit.Test;
import sponsor.Sponsor;

/**
 * This Test class tests the Sponsor class
 * 
 * @author Cassio Espindola
 * 
 */
public class SponsorTest {

	private Sponsor sponsor;

	@Before
	public void createSponsor() throws Exception {
		sponsor = new Sponsor("UFCG", "Silver", 300.49);
	}

	@Test(expected = Exception.class)
	public void createSponsorWithException() throws Exception {
		sponsor = new Sponsor("UFCG", "Gold", -300.4);
	}

	@Test
	public void TestSponsorConstructor() {
		Assert.assertEquals("Error at name sponsor Constructor", sponsor
				.getName(), "UFCG");
		Assert.assertEquals("Error at monthly sponsor Constructor", sponsor
				.getMonthly(), 300.49);
		Assert.assertEquals("Error at list of videos sponsor Constructor",
				sponsor.getVideos().size(), 0);
	}
}